
<!doctype html>
<html lang="en" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      
      
      
      <link rel="icon" href="../assets/images/favicon.png">
      <meta name="generator" content="mkdocs-1.3.0, mkdocs-material-8.2.13">
    
    
      
        <title>Reference - Calculation Docs</title>
      
    
    
      <link rel="stylesheet" href="../assets/stylesheets/main.e411adfe.min.css">
      
        
        <link rel="stylesheet" href="../assets/stylesheets/palette.cc9b2e1e.min.css">
        
      
    
    
    
      
        
        
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
        <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
      
    
    
      <link rel="stylesheet" href="../assets/_mkdocstrings.css">
    
    <script>__md_scope=new URL("..",location),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
    
      

    
    
  </head>
  
  
    
    
    
    
    
    <body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
  
    
    
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#reference" class="md-skip">
          Skip to content
        </a>
      
    </div>
    <div data-md-component="announce">
      
    </div>
    
    
      

<header class="md-header" data-md-component="header">
  <nav class="md-header__inner md-grid" aria-label="Header">
    <a href=".." title="Calculation Docs" class="md-header__button md-logo" aria-label="Calculation Docs" data-md-component="logo">
      
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>

    </a>
    <label class="md-header__button md-icon" for="__drawer">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
    </label>
    <div class="md-header__title" data-md-component="header-title">
      <div class="md-header__ellipsis">
        <div class="md-header__topic">
          <span class="md-ellipsis">
            Calculation Docs
          </span>
        </div>
        <div class="md-header__topic" data-md-component="header-topic">
          <span class="md-ellipsis">
            
              Reference
            
          </span>
        </div>
      </div>
    </div>
    
    
    
    
  </nav>
  
</header>
    
    <div class="md-container" data-md-component="container">
      
      
        
          
        
      
      <main class="md-main" data-md-component="main">
        <div class="md-main__inner md-grid">
          
            
              
              <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    


<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
  <label class="md-nav__title" for="__drawer">
    <a href=".." title="Calculation Docs" class="md-nav__button md-logo" aria-label="Calculation Docs" data-md-component="logo">
      
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>

    </a>
    Calculation Docs
  </label>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
      

  
  
  
    <li class="md-nav__item">
      <a href=".." class="md-nav__link">
        Calculation Docs
      </a>
    </li>
  

    
      
      
      

  
  
  
    <li class="md-nav__item">
      <a href="../tutorials/" class="md-nav__link">
        Tutorials
      </a>
    </li>
  

    
      
      
      

  
  
  
    <li class="md-nav__item">
      <a href="../how-to-guides/" class="md-nav__link">
        How-To Guides
      </a>
    </li>
  

    
      
      
      

  
  
    
  
  
    <li class="md-nav__item md-nav__item--active">
      
      <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
      
      
        
      
      
        <label class="md-nav__link md-nav__link--active" for="__toc">
          Reference
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <a href="./" class="md-nav__link md-nav__link--active">
        Reference
      </a>
      
        

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations" class="md-nav__link">
    calculator.calculations
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations.add" class="md-nav__link">
    add()
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations.divide" class="md-nav__link">
    divide()
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations.multiply" class="md-nav__link">
    multiply()
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations.subtract" class="md-nav__link">
    subtract()
  </a>
  
</li>
      
    </ul>
  
</nav>
      
    </li>
  

    
      
      
      

  
  
  
    <li class="md-nav__item">
      <a href="../explanation/" class="md-nav__link">
        Explanation
      </a>
    </li>
  

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              
              <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations" class="md-nav__link">
    calculator.calculations
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations.add" class="md-nav__link">
    add()
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations.divide" class="md-nav__link">
    divide()
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations.multiply" class="md-nav__link">
    multiply()
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#calculator.calculations.subtract" class="md-nav__link">
    subtract()
  </a>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
              </div>
            
          
          <div class="md-content" data-md-component="content">
            <article class="md-content__inner md-typeset">
              
                


<h1 id="reference">Reference</h1>
<p>This part of the project documentation focuses on
an <strong>information-oriented</strong> approach. Use it as a
reference for the technical implementation of the
<code>calculator</code> project code.</p>


  <div class="doc doc-object doc-module">

<a id="calculator.calculations"></a>
    <div class="doc doc-contents first">

      <p>Provide several sample math calculations.</p>
<p>This module allows the user to make mathematical calculations.</p>

<p><strong>Examples:</strong></p>
    <div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">from</span> <span class="nn">calculator</span> <span class="kn">import</span> <span class="n">calculations</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">calculations</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="mf">6.0</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">calculations</span><span class="o">.</span><span class="n">multiply</span><span class="p">(</span><span class="mf">2.0</span><span class="p">,</span> <span class="mf">4.0</span><span class="p">)</span>
<span class="mf">8.0</span>
<span class="o">&gt;&gt;&gt;</span> <span class="kn">from</span> <span class="nn">calculator.calculations</span> <span class="kn">import</span> <span class="n">divide</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">divide</span><span class="p">(</span><span class="mf">4.0</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="mf">2.0</span>
</code></pre></div>
      <p>The module contains the following functions:</p>
<ul>
<li><code>add(a, b)</code> - Returns the sum of two numbers.</li>
<li><code>subtract(a, b)</code> - Returns the difference of two numbers.</li>
<li><code>multiply(a, b)</code> - Returns the product of two numbers.</li>
<li><code>divide(a, b)</code> - Returns the quotient of two numbers.</li>
</ul>



  <div class="doc doc-children">








  <div class="doc doc-object doc-function">



<h2 id="calculator.calculations.add" class="doc doc-heading">
<code class="highlight language-python"><span class="n">add</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span></code>


</h2>

    <div class="doc doc-contents ">

      <p>Compute and return the sum of two numbers.</p>

<p><strong>Examples:</strong></p>
    <div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">add</span><span class="p">(</span><span class="mf">4.0</span><span class="p">,</span> <span class="mf">2.0</span><span class="p">)</span>
<span class="mf">6.0</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">add</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="mf">6.0</span>
</code></pre></div>

<p><strong>Parameters:</strong></p>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>
  <tbody>
      <tr>
        <td><code>a</code></td>
        <td><code>Union[float, int]</code></td>
        <td><p>A number representing the first addend in the addition.</p></td>
        <td><em>required</em></td>
      </tr>
      <tr>
        <td><code>b</code></td>
        <td><code>Union[float, int]</code></td>
        <td><p>A number representing the second addend in the addition.</p></td>
        <td><em>required</em></td>
      </tr>
  </tbody>
</table>
<p><strong>Returns:</strong></p>
<table>
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>float</code></td>
      <td><p>A number representing the arithmetic sum of <code>a</code> and <code>b</code>.</p></td>
    </tr>
  </tbody>
</table>
        <details class="quote">
          <summary>Source code in <code>calculator/calculations.py</code></summary>
          <div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="n">a</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">],</span> <span class="n">b</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="nb">float</span><span class="p">:</span>
    <span class="sd">&quot;&quot;&quot;Compute and return the sum of two numbers.</span>

<span class="sd">    Examples:</span>
<span class="sd">        &gt;&gt;&gt; add(4.0, 2.0)</span>
<span class="sd">        6.0</span>
<span class="sd">        &gt;&gt;&gt; add(4, 2)</span>
<span class="sd">        6.0</span>

<span class="sd">    Args:</span>
<span class="sd">        a: A number representing the first addend in the addition.</span>
<span class="sd">        b: A number representing the second addend in the addition.</span>

<span class="sd">    Returns:</span>
<span class="sd">        A number representing the arithmetic sum of `a` and `b`.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">return</span> <span class="nb">float</span><span class="p">(</span><span class="n">a</span> <span class="o">+</span> <span class="n">b</span><span class="p">)</span>
</code></pre></div>
        </details>
    </div>

  </div>



  <div class="doc doc-object doc-function">



<h2 id="calculator.calculations.divide" class="doc doc-heading">
<code class="highlight language-python"><span class="n">divide</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span></code>


</h2>

    <div class="doc doc-contents ">

      <p>Compute and return the quotient of two numbers.</p>

<p><strong>Examples:</strong></p>
    <div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">divide</span><span class="p">(</span><span class="mf">4.0</span><span class="p">,</span> <span class="mf">2.0</span><span class="p">)</span>
<span class="mf">2.0</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">divide</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="mf">2.0</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">divide</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="ne">ZeroDivisionError</span><span class="p">:</span> <span class="n">division</span> <span class="n">by</span> <span class="n">zero</span>
</code></pre></div>

<p><strong>Parameters:</strong></p>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>
  <tbody>
      <tr>
        <td><code>a</code></td>
        <td><code>Union[float, int]</code></td>
        <td><p>A number representing the dividend in the division.</p></td>
        <td><em>required</em></td>
      </tr>
      <tr>
        <td><code>b</code></td>
        <td><code>Union[float, int]</code></td>
        <td><p>A number representing the divisor in the division.</p></td>
        <td><em>required</em></td>
      </tr>
  </tbody>
</table>
<p><strong>Returns:</strong></p>
<table>
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>float</code></td>
      <td><p>A number representing the quotient of <code>a</code> and <code>b</code>.</p></td>
    </tr>
  </tbody>
</table>
<p><strong>Exceptions:</strong></p>
<table>
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
      <tr>
        <td><code>ZeroDivisionError</code></td>
        <td><p>An error occurs when the divisor is <code>0</code>.</p></td>
      </tr>
  </tbody>
</table>
        <details class="quote">
          <summary>Source code in <code>calculator/calculations.py</code></summary>
          <div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">divide</span><span class="p">(</span><span class="n">a</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">],</span> <span class="n">b</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="nb">float</span><span class="p">:</span>
    <span class="sd">&quot;&quot;&quot;Compute and return the quotient of two numbers.</span>

<span class="sd">    Examples:</span>
<span class="sd">        &gt;&gt;&gt; divide(4.0, 2.0)</span>
<span class="sd">        2.0</span>
<span class="sd">        &gt;&gt;&gt; divide(4, 2)</span>
<span class="sd">        2.0</span>
<span class="sd">        &gt;&gt;&gt; divide(4, 0)</span>
<span class="sd">        Traceback (most recent call last):</span>
<span class="sd">        ...</span>
<span class="sd">        ZeroDivisionError: division by zero</span>

<span class="sd">    Args:</span>
<span class="sd">        a: A number representing the dividend in the division.</span>
<span class="sd">        b: A number representing the divisor in the division.</span>

<span class="sd">    Returns:</span>
<span class="sd">        A number representing the quotient of `a` and `b`.</span>

<span class="sd">    Raises:</span>
<span class="sd">        ZeroDivisionError: An error occurs when the divisor is `0`.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">if</span> <span class="n">b</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
        <span class="k">raise</span> <span class="ne">ZeroDivisionError</span><span class="p">(</span><span class="s2">&quot;division by zero&quot;</span><span class="p">)</span>
    <span class="k">return</span> <span class="nb">float</span><span class="p">(</span><span class="n">a</span> <span class="o">/</span> <span class="n">b</span><span class="p">)</span>
</code></pre></div>
        </details>
    </div>

  </div>



  <div class="doc doc-object doc-function">



<h2 id="calculator.calculations.multiply" class="doc doc-heading">
<code class="highlight language-python"><span class="n">multiply</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span></code>


</h2>

    <div class="doc doc-contents ">

      <p>Compute and return the product of two numbers.</p>

<p><strong>Examples:</strong></p>
    <div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">multiply</span><span class="p">(</span><span class="mf">4.0</span><span class="p">,</span> <span class="mf">2.0</span><span class="p">)</span>
<span class="mf">8.0</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">multiply</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="mf">8.0</span>
</code></pre></div>

<p><strong>Parameters:</strong></p>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>
  <tbody>
      <tr>
        <td><code>a</code></td>
        <td><code>Union[float, int]</code></td>
        <td><p>A number representing the multiplicand in the multiplication.</p></td>
        <td><em>required</em></td>
      </tr>
      <tr>
        <td><code>b</code></td>
        <td><code>Union[float, int]</code></td>
        <td><p>A number representing the multiplier in the multiplication.</p></td>
        <td><em>required</em></td>
      </tr>
  </tbody>
</table>
<p><strong>Returns:</strong></p>
<table>
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>float</code></td>
      <td><p>A number representing the product of <code>a</code> and <code>b</code>.</p></td>
    </tr>
  </tbody>
</table>
        <details class="quote">
          <summary>Source code in <code>calculator/calculations.py</code></summary>
          <div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">multiply</span><span class="p">(</span><span class="n">a</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">],</span> <span class="n">b</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="nb">float</span><span class="p">:</span>
    <span class="sd">&quot;&quot;&quot;Compute and return the product of two numbers.</span>

<span class="sd">    Examples:</span>
<span class="sd">        &gt;&gt;&gt; multiply(4.0, 2.0)</span>
<span class="sd">        8.0</span>
<span class="sd">        &gt;&gt;&gt; multiply(4, 2)</span>
<span class="sd">        8.0</span>

<span class="sd">    Args:</span>
<span class="sd">        a: A number representing the multiplicand in the multiplication.</span>
<span class="sd">        b: A number representing the multiplier in the multiplication.</span>

<span class="sd">    Returns:</span>
<span class="sd">        A number representing the product of `a` and `b`.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">return</span> <span class="nb">float</span><span class="p">(</span><span class="n">a</span> <span class="o">*</span> <span class="n">b</span><span class="p">)</span>
</code></pre></div>
        </details>
    </div>

  </div>



  <div class="doc doc-object doc-function">



<h2 id="calculator.calculations.subtract" class="doc doc-heading">
<code class="highlight language-python"><span class="n">subtract</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span></code>


</h2>

    <div class="doc doc-contents ">

      <p>Calculate the difference of two numbers.</p>

<p><strong>Examples:</strong></p>
    <div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">subtract</span><span class="p">(</span><span class="mf">4.0</span><span class="p">,</span> <span class="mf">2.0</span><span class="p">)</span>
<span class="mf">2.0</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">subtract</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="mf">2.0</span>
</code></pre></div>

<p><strong>Parameters:</strong></p>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>
  <tbody>
      <tr>
        <td><code>a</code></td>
        <td><code>Union[float, int]</code></td>
        <td><p>A number representing the minuend in the subtraction.</p></td>
        <td><em>required</em></td>
      </tr>
      <tr>
        <td><code>b</code></td>
        <td><code>Union[float, int]</code></td>
        <td><p>A number representing the subtrahend in the subtraction.</p></td>
        <td><em>required</em></td>
      </tr>
  </tbody>
</table>
<p><strong>Returns:</strong></p>
<table>
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>float</code></td>
      <td><p>A number representing the difference between <code>a</code> and <code>b</code>.</p></td>
    </tr>
  </tbody>
</table>
        <details class="quote">
          <summary>Source code in <code>calculator/calculations.py</code></summary>
          <div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">subtract</span><span class="p">(</span><span class="n">a</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">],</span> <span class="n">b</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">int</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="nb">float</span><span class="p">:</span>
    <span class="sd">&quot;&quot;&quot;Calculate the difference of two numbers.</span>

<span class="sd">    Examples:</span>
<span class="sd">        &gt;&gt;&gt; subtract(4.0, 2.0)</span>
<span class="sd">        2.0</span>
<span class="sd">        &gt;&gt;&gt; subtract(4, 2)</span>
<span class="sd">        2.0</span>

<span class="sd">    Args:</span>
<span class="sd">        a: A number representing the minuend in the subtraction.</span>
<span class="sd">        b: A number representing the subtrahend in the subtraction.</span>

<span class="sd">    Returns:</span>
<span class="sd">        A number representing the difference between `a` and `b`.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">return</span> <span class="nb">float</span><span class="p">(</span><span class="n">a</span> <span class="o">-</span> <span class="n">b</span><span class="p">)</span>
</code></pre></div>
        </details>
    </div>

  </div>






  </div>

    </div>

  </div>

              
            </article>
          </div>
        </div>
        
      </main>
      
        <footer class="md-footer">
  
    <nav class="md-footer__inner md-grid" aria-label="Footer">
      
        
        <a href="../how-to-guides/" class="md-footer__link md-footer__link--prev" aria-label="Previous: How-To Guides" rel="prev">
          <div class="md-footer__button md-icon">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
          </div>
          <div class="md-footer__title">
            <div class="md-ellipsis">
              <span class="md-footer__direction">
                Previous
              </span>
              How-To Guides
            </div>
          </div>
        </a>
      
      
        
        <a href="../explanation/" class="md-footer__link md-footer__link--next" aria-label="Next: Explanation" rel="next">
          <div class="md-footer__title">
            <div class="md-ellipsis">
              <span class="md-footer__direction">
                Next
              </span>
              Explanation
            </div>
          </div>
          <div class="md-footer__button md-icon">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4Z"/></svg>
          </div>
        </a>
      
    </nav>
  
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <div class="md-copyright">
  
  
    Made with
    <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
      Material for MkDocs
    </a>
  
</div>
      
    </div>
  </div>
</footer>
      
    </div>
    <div class="md-dialog" data-md-component="dialog">
      <div class="md-dialog__inner md-typeset"></div>
    </div>
    <script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.2a1c317c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script>
    
    
      <script src="../assets/javascripts/bundle.ed9748b7.min.js"></script>
      
    
  </body>
</html>